//
//  StatusCellBottomView.swift
//  JLWeibo
//
//  Created by sunjinliang on 15/12/10.
//  Copyright © 2015年 sunjinliang. All rights reserved.
//

import UIKit

class StatusCellBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    /// 转发按钮
    private lazy var retweetBtn = UIButton(title: " 转发", image: "timeline_icon_retweet", color: UIColor.grayColor(), fontSize: 12)
    /// 评论按钮
    private lazy var commentBtn = UIButton(title: " 评论", image: "timeline_icon_comment", color: UIColor.grayColor(), fontSize: 12)
    /// 点赞按钮
    private lazy var likeBtn = UIButton(title: " 点赞", image: "timeline_icon_unlike", color: UIColor.grayColor(), fontSize: 12)

   
    private func setupUI(){
        backgroundColor = UIColor(white: 0.9, alpha: 1.0)
        addSubview(retweetBtn)
        addSubview(commentBtn)
        addSubview(likeBtn)
        
        retweetBtn.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(self.snp_left)
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo(self.snp_bottom)
        }
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(retweetBtn.snp_right)
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo(self.snp_bottom)
            make.width.equalTo(retweetBtn.snp_width)
        }
        likeBtn.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(commentBtn.snp_right)
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo(self.snp_bottom)
            make.right.equalTo(self.snp_right)
            make.width.equalTo(retweetBtn.snp_width)
        }
        let line1 = creatDividingline()
        let line2 = creatDividingline()
        addSubview(line1)
        addSubview(line2)
        line1.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(retweetBtn.snp_right)
            make.centerY.equalTo(retweetBtn.snp_centerY)
            make.width.equalTo(0.5)
            make.height.equalTo(retweetBtn.snp_height).multipliedBy(0.4)
        }
        line2.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentBtn.snp_right)
            make.centerY.equalTo(commentBtn.snp_centerY)
            make.width.equalTo(0.5)
            make.height.equalTo(retweetBtn.snp_height).multipliedBy(0.4)
        }
    }
    func creatDividingline()->UIView{
        let Dividingline = UIView()
        Dividingline.backgroundColor = UIColor.grayColor()
        return Dividingline
    }
}